package com.example.rabbit.rest;

import com.example.rabbit.callback.CallBackSender;
import com.example.rabbit.fanout.FanoutSender;
import com.example.rabbit.hello.HelloSender1;
import com.example.rabbit.topic.TopicSender;
import com.example.rabbit.user.UserSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RabbitTest
{
    @Autowired
    private HelloSender1 helloSender1;

    @Autowired
    private UserSender sender;

    @Autowired
    private TopicSender sender2;

    @Autowired
    private FanoutSender fanoutSender;

    @Autowired
    private CallBackSender callBackSender;

    @GetMapping("/hello")
    public void hello()
    {
        helloSender1.sendToMq();
    }

    @GetMapping("/user")
    public void user()
    {
        sender.sendToMq();
    }

    @GetMapping("/topic")
    public void topic()
    {
        sender2.send();
    }

    @GetMapping("/fanoutTest")
    public void fanoutTest()
    {
        fanoutSender.send();
    }

    @GetMapping("/callback")
    public void callbak()
    {
        callBackSender.send();
    }
}
